import requests from "@/utils/request";

export function getGoodList() {
    return requests({
        url: '/platform/good/goodList',
        method: 'get'
    })
}

export function getGoodInfo(goodId) {
    return requests({
        url: '/platform/good/getGood/' + goodId,
        method: 'get'
    })
}

export function generateToken(user_id, good_id) {
    return requests({
        url: '/platform/good/generateToken',
        method: 'get',
        params: {
            userId: user_id,
            goodId: good_id
        }
    })
}

export function seckill(user_id, good_id, token) {
    return requests({
        url: '/platform/good/seckill',
        method: 'post',
        data: {
            user_id,
            good_id,
            token
        }
    })
}